package com.mhc.suzuki.constant;

/**
 * Created by HMJ on 2017/9/4.
 */
public enum TaskStatusEnum {

    //待处理
    PENDING(0, "待处理"),
    ACCEPTANCE(1, "受理中"),
    HANDLED(2, "已处理");

    private Integer code;
    private String name;

    TaskStatusEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getNameByCode(Integer code){
        for(TaskStatusEnum item : TaskStatusEnum.values()){
            if(item.getCode().equals(code)){
                return item.getName();
            }
        }
        return "";
    }

}
